﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_GetMemberInClass]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_GetMemberInClass];
GO
CREATE PROCEDURE [dbo].[sproc_GetMemberInClass] 
    @ClassID int
/*

============================================================
功能:    得到组成员
参数:
    @ClassID int        :    组(类)ID
============================================================

*/

AS
--得到组的所有成员
SET NOCOUNT ON
--·@ClassID<=0时为所有的成员
IF @ClassID <=0 
    SELECT * from uds_staff where dimission=0
ELSE
    SELECT * from uds_staff where staff_id in (select staff_id from uds_staff_in_team where team_id = @ClassID) and dimission=0

SET NOCOUNT OFF